 package kn.cstf2.cop.Sql;

 public class CopSql {
   public static final String SELECCIONAR_COP;
   public static final String INSETAR_DATOS_DEFAULT_ENCOP;
   public static final String SELECCIONAR_IDyEXPORT_FROM_COP;
   public static final String INSERT_INTO_CONTACTS;
   public static final String UPDATE_CONTACTS_CONTACTSDATE_TRANSITIONS;
   public static final String SELECT_DATOS_FROM_CONTACT;
   public static final String DELETE_CONTACT;
   public static final String COUNT_CONTACTS;
   public static final String DESABLE_CONTACTS;
   public static final String SELECCIONAR_ALLDATACLIENTFROMSTK;
   public static final String SELECCIONAR_IFOWNERFROMKNKEY;
   public static final String UPDATE_REPORTING_TRANSITIONS;
   public static final String UPDATE_SCOPEOFSERVICE_TRANSITIONS;
   public static final String UPDATE_CONDITION_TRANSITIONS;
   public static final String UPDATE_CIELID_TRANSITIONS;
   public static final String UPDATE_CIELQMODULE_TRANSITIONS;
   public static final String UPDATE_ACON_TRANSITIONS;
   public static final String UPDATE_CARRIERCC_TRANSITIONS;
   public static final String UPDATE_WORKINGST_TRANSITIONS;
   public static final String UPDATE_SOP_TRANSITIONS;
   public static final String UPDATE_KPI_TRANSITIONS;
   public static final String UPDATE_BILLING_TRANSITIONS;
   public static final String UPDATE_CONTACTS_TRANSITIONS;
   public static final String UPDATE_COP;
   public static final String SELECT_ALLDATA_FROM_TRANSITIONS;
   public static final String UPDATE_TRANSITIONS;
   public static final String SELECCIONAR_ACCOUNTVISIBILITYFROMSTK;
   public static final String SELECCT_EXCEPTIONS_FROMSTK;
   public static final String SELECCT_KPIS_FROMSTK;
   public static final String INSERT_EXCEPTIONS_FROMSTK;
   public static final String INSERT_KPIS_FROMSTK;
   public static final String SELECCIONAR_CUSTOMSOLUTION_FROMSTK;
   public static final String UPDATE_CLIENTESTK;
    
    
   static {
       StringBuilder qryBuilder = new StringBuilder();
       qryBuilder.append("SELECT * "+
                " FROM t_clientes "+            
                " WHERE "+
                " knkey = ? ");
        SELECCIONAR_ALLDATACLIENTFROMSTK = qryBuilder.toString();
        
       qryBuilder = new StringBuilder();
       qryBuilder.append(" select winuser from c_users_vs_clientes where customernum = ? ");
        SELECCIONAR_ACCOUNTVISIBILITYFROMSTK = qryBuilder.toString();
        
                
        qryBuilder = new StringBuilder();
        qryBuilder.append("SELECT ifowner "+
            " FROM t_assign " +            
            " WHERE " +
            " knkey = ? ");
        SELECCIONAR_IFOWNERFROMKNKEY = qryBuilder.toString();
        
                
        qryBuilder = new StringBuilder();
        qryBuilder.append("SELECT a_fa_blocked, a_fa_pickup, a_fa_etschanged, \n" +
"       a_fa_shipped, a_fa_etachange, a_fa_arrived, a_fa_delivered, a_fa_other, \n" +
"       a_fa_detailother, a_fs_blocked, a_fs_pickup, a_fs_etschanged, \n" +
"       a_fs_shipped, a_fs_etachange, a_fs_arrived, a_fs_delivered, a_fs_other, \n" +
"       a_fs_detailother, a_fo_blocked, a_fo_pickup, a_fo_etschanged, \n" +
"       a_fo_shipped, a_fo_etachanged, a_fo_arrived, a_fo_delivered, \n" +
"       a_fo_other, a_fo_detailother, r_fa_oe, r_fa_fin, r_fa_vol, r_fa_tt, \n" +
"       r_fa_kpis, r_fa_qbrs, r_fa_other, r_fa_detailother, r_fo_oe, \n" +
"       r_fo_fin, r_fo_vol, r_fo_tt, r_fo_kpis, r_fo_qbrs, r_fo_other, \n" +
"       r_fo_detailother, r_fs_oe, r_fs_fin, r_fs_vol, r_fs_tt, r_fs_kpis, \n" +
"       r_fs_qbrs, r_fs_other, r_fs_detailother, adreq_fa_oms, adreq_fa_mms, \n" +
"       adreq_fa_webbooking, adreq_fa_idp, adreq_fa_addsts, adreq_fa_dashboard, \n" +
"       adreq_fa_tmgmnt, adreq_fa_cdists, adreq_fa_freightinvoice, adreq_fa_asn, \n" +
"       adreq_fa_other, adreq_fa_detailother, adreq_fs_oms, adreq_fs_mms, \n" +
"       adreq_fs_webbooking, adreq_fs_idp, adreq_fs_addsts, adreq_fs_dashboard, \n" +
"       adreq_fs_tmgmnt, adreq_fs_cdists, adreq_fs_freightinvoice, adreq_fs_asn, \n" +
"       adreq_fs_other, adreq_fs_detailother, adreq_fo_oms, adreq_fo_mms, \n" +
"       adreq_fo_webbooking, adreq_fo_idp, adreq_fo_addsts, adreq_fo_dashboard, \n" +
"       adreq_fo_tmgmnt, adreq_fo_cdists, adreq_fo_freightinvoice, adreq_fo_asn, \n" +
"       adreq_fo_other, adreq_fo_detailother, r_fz_oe, r_fz_fin, r_fz_vol, \n" +
"       r_fz_tt, r_fz_kpis, r_fz_qbrs, r_fz_other, r_fz_detailother, \n" +
"       cl_chckbx_report_de, cl_chckbx_report_fin, cl_chckbx_report_vol, \n" +
"       cl_chckbx_report_tt, cl_chckbx_report_kpis, cl_chckbx_report_qbrs, \n" +
"       cl_chckbx_report_other, cl_chckbx_report_detailother "+
            " FROM t_customer_solution " +            
            " WHERE " +
            " knkey = ? ");
        SELECCIONAR_CUSTOMSOLUTION_FROMSTK = qryBuilder.toString();
        
      
       qryBuilder = new StringBuilder();
       qryBuilder.append(" SELECT * FROM t_cop WHERE idtransitioncop = ? AND export = ? ");
       SELECCIONAR_COP = qryBuilder.toString();
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" INSERT INTO t_cop (export, fcl, lcl, perishables, brokerage, intermodal, insurance, "
               + " oceanfreight, blueancorline, seatransport, exportcustoms, inbondexp, importcustoms, inbondim, preallmotor, precombined, "
               + " onallmotor, oncombined, attachedfiles, pickuptosiling, customsclearance, "
               + " maincarriage, arrivaltocustoms, arrivaltodelivery, escortkn, escortclient, idtransitioncop )"
               + " VALUES ( ?, false, false,  false,  false,  false,  false,  false,  false,  false,  false, "
               + " false,  false,  false,  false,  false,  false,  false,  0,  false,  false,  false,  false, "
               + " false,  false,  false,  ? ) ");
       INSETAR_DATOS_DEFAULT_ENCOP = qryBuilder.toString();
        
        
        
       qryBuilder = new StringBuilder();
       qryBuilder.append(" SELECT id FROM t_cop WHERE idtransitioncop = ? AND export = false " );
       SELECCIONAR_IDyEXPORT_FROM_COP = qryBuilder.toString();
        
        
       qryBuilder = new StringBuilder();
       qryBuilder.append(" INSERT INTO c_contacts (idcop, type, name, position, company, email, phone, extention, mobile)"
               + " VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ? ) ");
       INSERT_INTO_CONTACTS = qryBuilder.toString();
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" UPDATE t_transitions SET contacts = ?, contactsdate = ? WHERE id = ? ");
       UPDATE_CONTACTS_CONTACTSDATE_TRANSITIONS = qryBuilder.toString();

   
       qryBuilder = new StringBuilder();
       qryBuilder.append(" SELECT * FROM c_contacts WHERE idcop = ?  ");
       SELECT_DATOS_FROM_CONTACT = qryBuilder.toString();
   
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" DELETE FROM c_contacts WHERE idcop = ?  ");
       DELETE_CONTACT = qryBuilder.toString();
       
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" select count(*) from c_contacts co inner join "
               + " t_cop cop on cop.id = co.idcop inner join t_transitions tr on tr.id = cop.idtransitioncop  "
               + " WHERE tr.id = ? ");
       COUNT_CONTACTS = qryBuilder.toString();
       
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" UPDATE t_transitions SET contacts = 'false', contactsdate = null WHERE id = ? ");
       DESABLE_CONTACTS = qryBuilder.toString();
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" UPDATE t_transitions SET reporting = ?, reportingdate = ? WHERE id = ? ");
       UPDATE_REPORTING_TRANSITIONS = qryBuilder.toString();
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" UPDATE t_transitions SET scopeofservice = ?, scopeofservicedate = ? WHERE id = ? ");
       UPDATE_SCOPEOFSERVICE_TRANSITIONS = qryBuilder.toString();
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" UPDATE t_transitions SET condition = ?, conditionsdate = ? WHERE id = ? ");
       UPDATE_CONDITION_TRANSITIONS = qryBuilder.toString();
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" UPDATE t_transitions SET cielid = ? WHERE id = ? ");
       UPDATE_CIELID_TRANSITIONS = qryBuilder.toString();
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" UPDATE t_transitions SET cielqmodule = ? WHERE id = ? ");
       UPDATE_CIELQMODULE_TRANSITIONS = qryBuilder.toString();
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" UPDATE t_transitions SET acon = ? WHERE id = ? ");
       UPDATE_ACON_TRANSITIONS = qryBuilder.toString();
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" UPDATE t_transitions SET carriercc = ? WHERE id = ? ");
       UPDATE_CARRIERCC_TRANSITIONS = qryBuilder.toString();
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" UPDATE t_transitions SET workingst = ?, workingstdate = ? WHERE id = ? ");
       UPDATE_WORKINGST_TRANSITIONS = qryBuilder.toString();
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" UPDATE t_transitions SET sop = ? WHERE id = ? ");
       UPDATE_SOP_TRANSITIONS = qryBuilder.toString();
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" UPDATE t_transitions SET kpi = ?, kpidate = ? WHERE id = ? ");
       UPDATE_KPI_TRANSITIONS = qryBuilder.toString();
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" UPDATE t_transitions SET billing = ?, billingdate = ? WHERE id = ? ");
       UPDATE_BILLING_TRANSITIONS = qryBuilder.toString();
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" UPDATE t_transitions SET contacts = ? WHERE id = ? ");
       UPDATE_CONTACTS_TRANSITIONS = qryBuilder.toString();
       
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" UPDATE t_clientes"
               + " companyname SET  = ? "
               + " comercialname SET  = ? "
               + " compaddress SET  = ? "
               + " rfc SET  = ? "
               + " ciudad SET  = ? "
               + " mcontactname SET  = ? "
               + " mcontactposition SET  = ? "
               + " mcontactphone SET  = ? "
               + " mcontactemail SET  = ? "
               + " c2contactname SET  = ? "
               + " c2contactposition SET  = ? "
               + " c2contactphone SET  = ? "
               + " c2contactemail SET  = ? "
               + " industry SET  = ? "
               + " subindustry SET  = ? "
               + " activebillingcust SET  = ? "
               + " acctype SET  = ? "
               + " accsponsor SET  = ? "
               + " accountowner SET  = ? "
               + " accountexecutive SET  = ? "
               + " invtterm SET  = ? "
               + " top100bygp SET  = ? "
               + " totalclass SET  = ? "
               + " lastupdatedate SET  = ? "
               + " creationdate SET  = ? "
               + " clientid SET  = ? "
               + " acon SET  = ? "
               + " logicaladdress SET  = ? "
               + " visibilitylevel SET  = ? "
               + " rdata SET  = ? "
               + " rbilliing SET  = ? "
               + " rvolume SET  = ? "
               + " rit SET  = ? "
               + " rkpis SET  = ? "
               + " other SET  = ? "
               + " otherreport SET  = ? "
               + " adata SET  = ? "
               + " abilling SET  = ? "
               + " avolume SET  = ? "
               + " ait SET  = ? "
               + " akpis SET  = ? "
               + " creditterms SET  = ? "
               + " creditcomments SET  = ? "
               + " kam SET  = ? "
               + " okam SET  = ? "
               + " gkam  SET  = ? "
               + " rkam SET  = ? "
               + " competitors SET  = ? "
               + " existanpersonalrelat SET  = ? "
               + " financialstability SET  = ? "
               + " contract SET  = ? "
               + " rfqdate SET  = ? "
               + " dcs SET  = ? "
               + " ubicadcs SET  = ? "
               + " desiciondcs SET  = ? "
               + " plants SET  = ? "
               + " ubicaplants SET  = ? "
               + " desicionplants SET  = ? "
               + " liabilities SET  = ? "
               + " contract_open SET  = ? "
               + " contract_close SET  = ? "
               + " exitclause SET  = ? "
               + " contract_renewal SET  = ? "
               + " contract_terms SET  = ? "
               + " contract_pricing_negociation SET  = ? "
               + " contract_other SET  = ? "
               + " contract_commodity SET  = ? "
               + " current_visibility SET  = ? "
               + " visibility_requ SET  = ? "
               + " edi SET  = ? "
               + " erp SET  = ? "
               + " ediformat SET  = ? "
               + " ivpproduct SET  = ? "
               // "report needs" text,
               + " comments_cust_solution SET  = ? "
               + " cb_fa SET  = ? "
               + " cb_fd SET  = ? "
               + " cb_fg SET  = ? "
               + " cb_fo SET  = ? "
               + " cb_fs SET  = ? "
               + " cb_fw SET  = ? "
               + " cb_fx SET  = ? "
               + " cb_fy SET  = ? "
               + " cb_fz SET  = ? "
               + " pb_fa SET  = ? "
               + " pb_fd SET  = ? "
               + " pb_fg SET  = ? "
               + " pb_fo SET  = ? "
               + " pb_fs SET  = ? "
               + " pb_fw SET  = ? "
               + " pb_fx SET  = ? "
               + " pb_fy SET  = ? "
               + " pb_fz SET  = ? "
               + " vlog_check_acon SET  = ? "
               + " vlog_check_logadd SET  = ? "
               + " vlog_check_organization SET  = ? "
               + " vlog_check_contact SET  = ? "
               + " vlog_check_opportu SET  = ? "
               + " vlog_check_quotation SET  = ? "
               + " vlog_check_signed SET  = ? "
               + " vlog_check_sop SET  = ? "
               + " alert_delivered SET  = ? "
               + " alert_other SET  = ? "
               + " invoice_receive_date SET  = ? "
               + " creditlimit SET  = ? "
               + " billingcurrency SET  = ? "
               + " billingto SET  = ? "
               + " invoicerevisiondate SET  = ? "
               + " payablecontactname SET  = ? "
               + " payablecontactphone SET  = ? "
               + " payablecontactemail SET  = ? "
               + " specialinvoicecomments SET  = ? "
               + " accountprofilecoments SET  = ? "
               + " objectivesaccprofile SET  = ? "
               + " beginingdate_accprofile SET  = ? "
               + " deadlinedate_accprofile SET  = ? "
               + " qbryear SET  = ? "
               + " qbr SET  = ? "
               + " knparticipants SET  = ? "
               + " custparticipants SET  = ? "
               + " sc_otros SET  = ? "
               + " sc_proyects SET  = ? "
               + " sc_almacenaje SET  = ? "
               + " sc_distrib SET  = ? "
               + " sc_fact_mens_fw SET  = ? "
               + " sc_gp_mensual_fw SET  = ? "
               + " sc_fact_mens_fd SET  = ? "
               + " sc_gp_mensual_fd SET  = ? "
               + " shipping_comments SET  = ? "
               + " chklistbeginingdate_ff SET  = ? "
               + " chklistfinishingdate_ff SET  = ? "
               + " chklistbeginningdate_cl SET  = ? "
               + " chklistfinishingdate_cl SET  = ? "
               + " cl_comomdity SET  = ? "
               + " cl_wms SET  = ? "
               + " cl_tms SET  = ? "
               + " cl_wms_detail SET  = ? "
               + " cl_tms_detail SET  = ? "
               + " acc_plann_date SET  = ? "
               + " lastupdate_date SET  = ? "
               + " plataform SET  = ? "
               + " cust_zipcode SET  = ? "
               + " cust_comments SET  = ? "
               + " tmkt_saleslead SET  = ? "
               + " chklist_cq SET  = ? "
               + " chklist_cp SET  = ? "
               + " chklist_ap SET  = ? "
               + " chklist_chek SET  = ? "
               + " chklist_internal SET  = ? "
               + " chklist_csummary SET  = ? "
               + " creator SET  = ? "
               + " creator_date SET  = ? "
               + " next_rfq_ff SET  = ? "
               + " next_rfq_cl SET  = ? "
               + " account_family SET  = ? "
               + "WHERE knkey = ? ");
       UPDATE_CLIENTESTK = qryBuilder.toString();
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" SELECT * FROM t_transitions WHERE id = ? ");
       SELECT_ALLDATA_FROM_TRANSITIONS = qryBuilder.toString();
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" UPDATE t_cop SET overview = ?, fcl = ?, lcl = ?, perishables = ?, brokerage = ?, "
               + " intermodal = ?, insurance = ?, oceanfreight = ?, blueancorline = ?, seatransport = ?, "
               + " exportcustoms = ?, inbondexp = ?, importcustoms = ?, inbondim = ?, preallmotor = ?, "
               + " precombined = ?, onallmotor = ?, oncombined = ?, originconditions = ?, destconditions = ?, "
               + " workinst = ?, attachedfiles = ?, requirements = ?, pickuptosiling = ?, customsclearance = ?, "
               + " maincarriage = ?, arrivaltocustoms = ?, arrivaltodelivery = ?, escortkn = ?, escortclient = ?, "
               + " protocol = ?, precarrier = ?, oncarriage = ? WHERE idtransitioncop = ? AND export = ? ");
       UPDATE_COP = qryBuilder.toString();
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" UPDATE t_transitions SET knkey = ?, status = ?, log = ?, contacts = ?, contactsdate = ?, "
               + " reporting = ?, reportingdate = ?, scopeofservice = ?, scopeofservicedate = ?, condition = ?, "
               + " conditionsdate = ?, cielid = ?, cieliddate = ?, cielqmodule = ?, cielqmoduledate = ?, acon = ?, "
               + " acondate = ?, carriercc = ?, carrierccdate = ?, workingst = ?, workingstdate = ?, sop = ?, "
               + " sopdate = ?, kpi = ?, kpidate = ?, billing = ?, billingdate = ?  WHERE id = ? ");
       UPDATE_TRANSITIONS = qryBuilder.toString();
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" SELECT * FROM c_exceptions  WHERE idcop = ? ");
       SELECCT_EXCEPTIONS_FROMSTK = qryBuilder.toString();
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" SELECT * FROM c_kpis  WHERE idcop = ? ");
       SELECCT_KPIS_FROMSTK = qryBuilder.toString();
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" INSERT INTO c_exceptions (idcop, exceptcode, exceptlogic ) VALUES( ?, ?, ? ) ");
       INSERT_EXCEPTIONS_FROMSTK = qryBuilder.toString();
       
       
       qryBuilder = new StringBuilder();
       qryBuilder.append(" INSERT INTO c_kpis (idcop, kpicode, kpilogic ) VALUES ( ?, ?, ? )");
       INSERT_KPIS_FROMSTK = qryBuilder.toString();
   }
}
